1. Field of the Invention
The present invention relates to a video encoding device for encoding video signals.
2. Description of the Related Art
In recent years, a digital video camera has been widely used to capture moving pictures (video), encode the pictures generating compressed streams, and then record digital signals of the streams onto a recording medium. For the encoding, standards of DVC, MPEG-2 (ISO/IEC 13818-2), MPEG-4 (ISO/IEC 14496-2) and the like have been intensely applied.
Moreover, a standard known as H.264 (ITU-T Rec. H.264), which is aimed initially at encoding video for teleconferences, has recently been standardized. The H.264 standard requires a greater amount of processing for encoding and decoding as compared to the MPEG-2 and MPEG-4 standards, but can achieve higher encoding efficiency.
One methods to achieve a high encoding efficiency by using entropy encoding of the H.264 standard is an encoding method called a context-based adaptive binary arithmetic coding (CABAC). In the CABAC, input data is binarized, a possibility of generation of the same binary data is calculated by an arithmetic operation depending on a context (a current target to be encoded and a situation of circumstances), and then the binary data is encoded with encode bits according to the possibility of generation of the same binary data. Thereby high-efficient encoding can be achieved. In the CABAC, however, the input data is not directly transformed. That is, the input data is encoded with bits whose number is set irregularly by updating the possibility of the generation of the binary data, so that it is necessary to increase a capacity of a buffer (binary buffer) for temporarily storing the binary data to be encoded.
In order to prevent the processing amount in the CABAC from exceeding a predetermined amount, Japanese Patent Laid-Open No. 2004-135251 publication (hereinafter, referred to as document 1) suggests a device which monitors an amount of data that is outputted by a binarization unit for generating binary data, and when the amount of data to be processed per predetermined encoding sizes reaches a predetermined value, performs an encoding that is different from a previously performed encoding.
A video encoding device 600 suggested in the document 1 includes a limitation monitor unit 62 as shown in FIG. 1. The limitation monitor unit 62 monitors, per the predetermined encoding sizes, whether or not an amount of data outputted from a binarization unit 30 in a CABAC processing unit 61 to a binary buffer 31 reaches the first value. The limitation monitor unit 62 further monitors, per the predetermined encoding sizes, whether or not an amount of data outputted from a binary arithmetic encoding unit 33 reaches the second value.
When the amount of the data outputted from the binarization unit 30 reaches the first value, or when the amount of the data outputted from the binary arithmetic encoding unit 33 reaches the second value, the limitation monitor unit 62 outputs a monitor signal to an encoding control unit 63. The encoding control unit 63 makes an orthogonal transform unit 3, a quantization unit 22, and the like repeat the same processing as performed previously for the video signal corresponding to the monitor signal. As described above, when the amount of the data outputted from the binarization unit 30 reaches the first value, the same processing as previously performed is repeated for the identical video signal. Thereby the binary data stored in the binary buffer 31 is processed during repeating of the processing, so that an available space in the binary buffer 31 is increased in practice. As a result, it is possible to reduce a capacity of the binary buffer 31.
However, in the video encoding device 600 in the document 1, when the monitor signal is outputted, the orthogonal transform unit 3, the quantization unit 22, and the like repeat the same processing as performed previously. Therefore the video encoding device 600 is not suitable as a device for processing the video signal in real time. Moreover, since the orthogonal transform unit 3, the quantization unit 22, and the like repeat the same processing as performed previously, there is a possibility that another monitor signal is outputted again from the limitation monitor unit 62. To prevent the above problem, the encoding control unit 63 changes a value of a parameter set for each component in order to reduce an amount of data to be monitored by the limitation monitor unit 62 as much as possible, and then makes the orthogonal transform unit 3, the quantization unit 22, and the like repeat the same processing. As a result, quality of images (including resolution and the like) generated from the eventually obtained data is reduced.
Furthermore, a technology as shown in FIG. 2 is also suggested. More specifically, in order to reduce the capacity of the binary buffer 31, the technology suggests that a signal is outputted from the quantization unit 22 to the outside of the video encoding device 700, instead of outputting to the CABAC processing unit 61, when the limitation control unit 62 outputs the monitor signal. In this case, however, the signal from the quantization unit 22 cannot be outputted directly to the outside of the device 700, so that it is necessary to add processing simply performed by a processing unit 75 for the signal to be outputted from the quantization unit 22 to the outside. Furthermore, it is necessary to add a selection unit 76 to the video encoding device 700 in order to select the signal obtained from the CABAC processing unit 61 or the signal obtained from the signal processing unit 75. Thereby a size of the device is increased.